Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ticket/10744] Reserved style directory names #690

Closed
wants to merge 1 commit into from
Closed

[ticket/10744] Reserved style directory names #690

wants to merge 1 commit into from

Conversation

cyberalien
Copy link
Contributor

Prevent user from installing styles with reserved directory names

http://tracker.phpbb.com/browse/PHPBB3-10744

@@ -26,6 +26,7 @@ class acp_styles
var $mode;
var $styles_path;
var $styles_path_absolute = 'styles';
var $reserved_keywords = array('all', 'admin', 'all');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all listed twice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doh. Thanks

@igorw
Copy link
Contributor

igorw commented Apr 2, 2012

Looks good. 👍

Prevent user from installing styles with reserved directory names

PHPBB3-10744
@cyberalien
Copy link
Contributor Author

Updated. Fixed merge conflict and renamed $reserved_keywords to $reserved_paths because that array is array of style paths

@@ -272,6 +272,7 @@
'REPLACE_THEME_EXPLAIN' => 'This theme will replace the one you are deleting in any styles that use it.',
'REPLACE_WITH_OPTION' => 'Replace with “%s”',
'REQUIRES_STYLE' => 'This style requires the style "%s" to be installed.',
'RESERVED_STYLE_DIR' => 'Directory "%s" is reserved, please move style to a different directory.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use "style name" instead of "directory"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style names are not related to directories, so that would be incorrect. Simply renaming directory will make style installable.

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it even possible that name and directory differ? Is there any advantage to that? Can't we just make it a lot simpler by requiring they always be the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea why. I also have no idea why template inheritance works by style name instead of directory name (but stores path in database).

I think it would make sense to use directory name for style name. Maybe close this PR for now and make RFC about removing style name completely?

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, let's do that.

@callumacrae
Copy link
Contributor

Diff looks good.

@naderman naderman closed this Apr 19, 2012
@naderman
Copy link
Sponsor Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants